import { http } from '@/utils/http'

import type { RootObject } from "@/types/unManaged.d.ts"

// 获取用户机器列表
export const getManagerList = (data) => {
	return http({
		method: 'GET',
		url: '/api/server/managed/getManagerList',
		data
	})
}
// koi机器产出
export const getKOIIncome = (data) => {
	return http({
		method: 'GET',
		url: '/api/server/userMachine/getKOIIncome',
		data
	})
}
// 我的页面订单列表
export const getList = (data) => {
	return http({
		method: 'GET',
		url: '/api/server/order/getOrderList',
		data
	})
}
// 提交托管
export const machineHosting = (data) => {
	return http({
		method: 'POST',
		url: '/api/server/managed/submitManager',
		data
	})
}
// 用户未托管订单
export const UnmanagedOrders = () => {
	return http<RootObject[]>({
		method: 'GET',
		url: '/api/server/managed/getUnManagedOrderList',
	})
}

// 用户兑换券
export const getExchangeCodeAPI = () => {
	return http<{
		unusedCount : number,
		usedCount : number,
	}>({
		method: 'GET',
		url: '/api/server/managed/getUserExchangeCodeSum',
	})
}